import request from "./axios";

//get请求
export const get = (url: string, parmas: Record<string, unknown>) => {
  return request({
    url,
    method: 'GET',
    params: parmas
  })
}
//post请求
export const post = (url: string, data: Record<string, unknown>, headers?: { userId?: number | string; sessionId?: string }) => {
  return request({
    url,
    method: 'POST',
    data,
    headers: headers ? {
      userId: headers.userId,
      sessionId: headers.sessionId,
    } : undefined
  })
}

